<?php echo $this->render('header.phtml'); ?>
<label class="title">Commodities - view a commodity</label>
<div class="horiz_sep">&nbsp;</div>
<?php 
	$com = $this->commodity;
	$status = $this->status;
	$images = $this->images;
?>
<table cellpadding="0" cellspacing="0" width="100%">
  	<tr>
    	<td>Name: </td>
    	<td><?= $com->com_name; ?></td>
  	</tr>  	
  	<tr>
    	<td>Status: </td>
    	<td><?= $status->sta_name; ?></td>
  	</tr>
  	<tr>
    	<td>Avail: </td>
    	<td>
    		<? 
    			if ($com->com_avail) echo "Con hang";
    			else echo "Het hang"; 
    		?>
    	</td>
  	</tr>
  	<tr>
    	<td>Price: </td>
    	<td><?= $com->com_price; ?></td>
  	</tr>
  	<tr>
    	<td>Banned: </td>
    	<td>
    		<? 
    			if ($com->com_banned) echo "YES";
    			else echo "NO"; 
    		?>
    	</td>
  	</tr>
  	<tr>
    	<td>Vip: </td>
    	<td>
    		<?
    			if ($com->com_vip) echo "YES";
    			else echo "NO"; 
    		?>
    	</td>
  	</tr>
  	<tr>
    	<td>Hit: </td>
    	<td><?= $com->com_hit; ?></td>
  	</tr>
  	<tr>
    	<td>Posted date: </td>
    	<td><?= $this->utilities->formatdate($com->com_posted_date); ?></td>
  	</tr>
  	<tr>
    	<td colspan="2">Description:</td>
  	</tr>
  	<tr>    	
    	<td colspan="2"><?= $com->com_description; ?></td>
  	</tr>
  	<?php
  		if (count($images)){
  			foreach ($images as $image){
  				$image_path = $image->img_path.$image->img_title;
  				echo "<tr><td>";
  				echo "<img src='$image_path' />";
  				echo "</td></tr>";
  			}
  		} 
  	?>
</table>

<?php echo $this->render('footer.phtml');?> 